Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #92 - Update dependencies to symfony v7.0 #95

Closed
wants to merge 1 commit into from

Conversation

fsangar
Copy link

@fsangar fsangar commented Jan 28, 2024

This update removes the use of Annotations (e.g., @breadcrumb("Level 1")) and now requires the use of Attributes (e.g., #[Breadcrumb(title: 'Level 1')]). There are some deprecations in the code that should be addressed.

@rvanlaak
Copy link
Collaborator

Dropping the Symfony 4.x support is okay, but will be a BC break.

Approved the tests to run, these are failing.

@@ -19,5 +19,14 @@
<tag name="kernel.event_listener" event="kernel.controller" method="onKernelController" priority="-1" />
</service>
<service id="apy_breadcrumb_trail.annotation.listener" alias="APY\BreadcrumbTrailBundle\EventListener\BreadcrumbListener" public="true" />

<!-- Definición del servicio AnnotationReader -->
<service id="Doctrine\Common\Annotations\AnnotationReader" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As can be seen in the composer.json this bundle does not have a dependency on doctrine annotations, so this approach is not correct as the class potentially is not there. The service retrieval and tagging on the lines below should happen in a compiler pass instead.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you look the BreadcrumbLister.php file, you can see dependencia of Doctrine\Common\Annotations\Reader;

When you run the tests with the last version with symfony 6.0, we can look this message
7x: Since symfony/framework-bundle 6.4: The "Doctrine\Common\Annotations\Reader" service alias is deprecated without replacement. It is being referenced by the "APY\BreadcrumbTrailBundle\EventListener\BreadcrumbListener" service.
1x in BundleInitializationTest::testServicesAreRegisteredToContainer from APY\BreadcrumbTrailBundle
1x in BreadcrumbListenerTest::testAnnotations from APY\BreadcrumbTrailBundle\EventListener
1x in BreadcrumbListenerTest::testAttributes from APY\BreadcrumbTrailBundle\EventListener
1x in BreadcrumbListenerTest::testMixingAnnotationsWithAttributesFails from APY\BreadcrumbTrailBundle\EventListener
1x in BreadcrumbListenerTest::testInvokableController from APY\BreadcrumbTrailBundle\EventListener
...

@fsangar fsangar closed this Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants